data = gdk_wayland_seat_find_pad (GDK_WAYLAND_SEAT (seat),
GDK_DEVICE (pad));
+#ifdef G_DISABLE_ASSERT
+ if (data == NULL)
+ return 0;
+#else
g_assert (data != NULL);
+#endif
return g_list_length (data->mode_groups);
}
data = gdk_wayland_seat_find_pad (GDK_WAYLAND_SEAT (seat),
GDK_DEVICE (pad));
+#ifdef G_DISABLE_ASSERT
+ if (data == NULL)
+ return 0;
+#else
g_assert (data != NULL);
+#endif
group = g_list_nth_data (data->mode_groups, n_group);
if (!group)
data = gdk_wayland_seat_find_pad (GDK_WAYLAND_SEAT (seat),
GDK_DEVICE (pad));
+#ifdef G_DISABLE_ASSERT
+ if (data == NULL)
+ return -1;
+#else
g_assert (data != NULL);
+#endif
for (l = data->mode_groups, i = 0; l; l = l->next, i++)
{
wp_tablet_pad, button, state));
group = tablet_pad_lookup_button_group (pad, button);
+
+#ifdef G_DISABLE_ASSERT
+ if (group == NULL)
+ return;
+#else
g_assert (group != NULL);
+#endif
+
n_group = g_list_index (pad->mode_groups, group);
event = gdk_pad_event_new_button (state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED
#include "gdk/gdk-private.h"
+/* Keep g_assert() defined even if we disable it globally,
+ * as we use it in many places as a handy mechanism to check
+ * for non-NULL
+ */
+#ifdef G_DISABLE_ASSERT
+# undef g_assert
+# define g_assert(expr) G_STMT_START { \
+ if G_LIKELY (expr) ; else \
+ g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ #expr); \
+ } G_STMT_END
+#endif
+
/**
* GdkWaylandDisplay:
*